#ifndef _TASK_H
#define _TASK_H

#include "util.h"
#include "paging.h"

#define KERNEL_STACK_SIZE 2048

typedef struct task
{
	int id;
	unsigned int esp, ebp;
	unsigned int eip;
	page_directory_t *page_directory;
	unsigned int kernel_stack;   // Kernel stack location.
	struct task *next;
} task_t;

void initialize_tasking();

void switch_task();

int fork();

int new_task(void (*entry)(void));

void move_stack(void *new_stack_start, unsigned int size);

int getpid();

void user_mode();

#endif
